\(\int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx\) [17]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 15 \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\frac {\sin ^4(a+b x)}{2 b} \]

[Out]

1/2*sin(b*x+a)^4/b

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4373, 2644, 30} \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\frac {\sin ^4(a+b x)}{2 b} \]

[In]

Int[Sin[a + b*x]^2*Sin[2*a + 2*b*x],x]

[Out]

Sin[a + b*x]^4/(2*b)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2644

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 4373

Int[((f_.)*sin[(a_.) + (b_.)*(x_)])^(n_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/f^p, Int[Cos[a
+ b*x]^p*(f*Sin[a + b*x])^(n + p), x], x] /; FreeQ[{a, b, c, d, f, n}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = 2 \int \cos (a+b x) \sin ^3(a+b x) \, dx \\ & = \frac {2 \text {Subst}\left (\int x^3 \, dx,x,\sin (a+b x)\right )}{b} \\ & = \frac {\sin ^4(a+b x)}{2 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\frac {\sin ^4(a+b x)}{2 b} \]

[In]

Integrate[Sin[a + b*x]^2*Sin[2*a + 2*b*x],x]

[Out]

Sin[a + b*x]^4/(2*b)

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(29\) vs. \(2(13)=26\).

Time = 0.33 (sec) , antiderivative size = 30, normalized size of antiderivative = 2.00

method result size
default \(-\frac {\cos \left (2 x b +2 a \right )}{4 b}+\frac {\cos \left (4 x b +4 a \right )}{16 b}\) \(30\)
risch \(-\frac {\cos \left (2 x b +2 a \right )}{4 b}+\frac {\cos \left (4 x b +4 a \right )}{16 b}\) \(30\)
parallelrisch \(\frac {-\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4} \tan \left (x b +a \right ) x b +\left (2 \tan \left (x b +a \right )^{2} x b -2 x b -2 \tan \left (x b +a \right )\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3}+\left (6 \tan \left (x b +a \right ) x b +4 \tan \left (x b +a \right )^{2}-4\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}+\left (-2 \tan \left (x b +a \right )^{2} x b +2 x b +2 \tan \left (x b +a \right )\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )-\tan \left (x b +a \right ) x b}{2 b \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )^{2} \left (1+\tan \left (x b +a \right )^{2}\right )}\) \(171\)
norman \(\frac {x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )+x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3} \tan \left (x b +a \right )^{2}+\frac {\tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (x b +a \right )}{b}-x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3}-\frac {x \tan \left (x b +a \right )}{2}-x \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (x b +a \right )^{2}+3 x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (x b +a \right )-\frac {x \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{4} \tan \left (x b +a \right )}{2}-\frac {2 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{b}+\frac {2 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (x b +a \right )^{2}}{b}-\frac {\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{3} \tan \left (x b +a \right )}{b}}{\left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right )^{2} \left (1+\tan \left (x b +a \right )^{2}\right )}\) \(226\)

[In]

int(sin(b*x+a)^2*sin(2*b*x+2*a),x,method=_RETURNVERBOSE)

[Out]

-1/4*cos(2*b*x+2*a)/b+1/16*cos(4*b*x+4*a)/b

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.60 \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\frac {\cos \left (b x + a\right )^{4} - 2 \, \cos \left (b x + a\right )^{2}}{2 \, b} \]

[In]

integrate(sin(b*x+a)^2*sin(2*b*x+2*a),x, algorithm="fricas")

[Out]

1/2*(cos(b*x + a)^4 - 2*cos(b*x + a)^2)/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (10) = 20\).

Time = 0.37 (sec) , antiderivative size = 131, normalized size of antiderivative = 8.73 \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\begin {cases} \frac {x \sin ^{2}{\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )}}{4} + \frac {x \sin {\left (a + b x \right )} \cos {\left (a + b x \right )} \cos {\left (2 a + 2 b x \right )}}{2} - \frac {x \sin {\left (2 a + 2 b x \right )} \cos ^{2}{\left (a + b x \right )}}{4} - \frac {\sin ^{2}{\left (a + b x \right )} \cos {\left (2 a + 2 b x \right )}}{2 b} + \frac {\sin {\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )}}{4 b} & \text {for}\: b \neq 0 \\x \sin ^{2}{\left (a \right )} \sin {\left (2 a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(sin(b*x+a)**2*sin(2*b*x+2*a),x)

[Out]

Piecewise((x*sin(a + b*x)**2*sin(2*a + 2*b*x)/4 + x*sin(a + b*x)*cos(a + b*x)*cos(2*a + 2*b*x)/2 - x*sin(2*a +
 2*b*x)*cos(a + b*x)**2/4 - sin(a + b*x)**2*cos(2*a + 2*b*x)/(2*b) + sin(a + b*x)*sin(2*a + 2*b*x)*cos(a + b*x
)/(4*b), Ne(b, 0)), (x*sin(a)**2*sin(2*a), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.73 \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\frac {\cos \left (4 \, b x + 4 \, a\right ) - 4 \, \cos \left (2 \, b x + 2 \, a\right )}{16 \, b} \]

[In]

integrate(sin(b*x+a)^2*sin(2*b*x+2*a),x, algorithm="maxima")

[Out]

1/16*(cos(4*b*x + 4*a) - 4*cos(2*b*x + 2*a))/b

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\frac {\sin \left (b x + a\right )^{4}}{2 \, b} \]

[In]

integrate(sin(b*x+a)^2*sin(2*b*x+2*a),x, algorithm="giac")

[Out]

1/2*sin(b*x + a)^4/b

Mupad [B] (verification not implemented)

Time = 19.26 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.87 \[ \int \sin ^2(a+b x) \sin (2 a+2 b x) \, dx=\frac {{\sin \left (a+b\,x\right )}^4}{2\,b} \]

[In]

int(sin(a + b*x)^2*sin(2*a + 2*b*x),x)

[Out]

sin(a + b*x)^4/(2*b)